﻿@model IEnumerable<KM.ENT.entSanPham>
@using CORE;
@using KM.HtmlHelpers
@{
    Layout = "~/Areas/REM/Views/Shared/Master.cshtml";
}

<div class="content">
    <!-- content-left-begin -->
    <div class="content_left">
        <!-- menu-cate-begin -->
        <div class="menu_cate">
            <div class="menu_cate_header">
            </div>
            <div class="menu_cate_top">
            </div>
            <div class="menu_cate_center">
                @{Html.RenderAction("Index", "LeftMenu");}
            </div>
            <div class="menu_cate_bottom">
            </div>
        </div>
        <!-- menu-cate-end -->
    </div>
    <!-- content-left-end -->
    <!-- content-right-begin -->
    <div class="content_right">
        <!-- content_items-open -->
        <div class="content_items">
            <div class="content_items_header">
                <a href="@Url.Action("Danhsach", null, new { Id = ViewBag.Id, Name = ViewBag.Name })" title="">
                    @ViewBag.SanPham
                    »
                </a>
            </div>

            @{
                int dem = 1;
                string cssclass = "";
                foreach (var item in Model)
                {
                    switch (dem)
                    {
                        case 1:
                            cssclass = "";
                            dem = 2;
                            break;
                        case 2:
                            cssclass = "item_pub_mid";
                            dem = 3;
                            break; ;
                        case 3:
                            cssclass = "";
                            dem = 1;
                            break;

                    }
                    <div class="item_pub @cssclass">
                        <div class="item_image">
                            <a href="@Url.Action("chitiet", "sanpham", new {id=item.Id, Name=Utils.GetTitle(@item.TenSanPham)})" title="@item.TenSanPham">
                                <img width="221" height="279" class="clsImage" src="/images/@item.Image" alt="@item.TenSanPham" title="@item.TenSanPham">
                            </a>
                            <p class="pub_image_more">
                                <a href="@Url.Action("chitiet", "sanpham", new {id=item.Id, Name=Utils.GetTitle(@item.TenSanPham)})" title="@item.TenSanPham"></a>
                            </p>
                            <p class="pub_image_button">
                                <a href="@Url.Action("chitiet", "sanpham", new {id=item.Id, Name=Utils.GetTitle(@item.TenSanPham)})" title="@item.TenSanPham">XEM NGAY</a>
                            </p>
                            <p class="pub_special">
                            </p>
                            <p>
                            </p>
                        </div>
                        <div class="item_info">
                            <div class="info_manu">
                                <span><a href="@Url.Action("chitiet", "sanpham", new {id=item.Id, Name=Utils.GetTitle(@item.TenSanPham)})" title="@item.TenSanPham">@item.TenSanPham</a></span>
                            </div>
                            @*<div class="info_title">
                                    <strong><a href="@Url.Action("chitiet", "sanpham", new {id=item.Id })" title="Đầm Vintage Hoa">@item.TenSanPham</a></strong>
                                </div>*@
                            <div class="info_price">
                                <p class="pub_price2">
                                    @{
                                        if (@item.GiaBan == 0)
                                        {
                                            <span>Liên hệ</span>
                                        }
                                        else
                                        {
                                            <span>@item.GiaBan<span class="text_small">đ</span></span>
                                        }
}
                                    
                                </p>
                                <p class="pub_price1">
                                    <span class="line_through"></span>
                                </p>
                                <p class="pub_code">
                                    <span>Mã: R@{@item.Id}</span>
                                </p>
                            </div>
                        </div>
                    </div>

                }
            }
            <div style="clear:both"></div>
            @Html.PhanTrang((KM.Models.PagingInfoModel)ViewBag.Page, x => Url.Action("danhsach", null, new { Id = ViewBag.Id, Name = ViewBag.Name, page = x }))
            
        </div>
        <!-- content_items-end -->
    </div>
    <!-- content-right-end -->
</div>
